package com.itheima;

import java.util.Scanner;
import java.util.TreeSet;

public class Demo6 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入字符:");
        String s = sc.nextLine();
        TreeSet<Character> set = new TreeSet<>();

        for (int i = 0; i < s.length(); i++) {
            set.add(s.charAt(i));
        }

        StringBuilder sb= new StringBuilder();
        for (Character car :set){
           sb.append(car);
        }
        String result = sb.toString();
        System.out.println(result);
    }
}
